From f7463a99139aaa01df0345830b79e48c0ee89fab Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Wed, 30 Jul 2003 21:27:29 +0000 Subject: [PATCH] bitkeeper revision 1.387 (3f283841sxL_1BFf_Dks40SWU9PRqg) dev.c: Fix possible subtle race in new network tx code. --- xen/net/dev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/net/dev.c b/xen/net/dev.c index b1a87ffb83..e9e965c7e9 100644 --- a/xen/net/dev.c +++ b/xen/net/dev.c @@ -836,6 +836,12 @@ static void tx_skb_release(struct sk_buff *skb) __make_tx_response(vif, skb->guest_id, RING_STATUS_OK); spin_unlock_irqrestore(&vif->tx_lock, flags); + /* + * Checks below must happen after the above response is posted. + * This avoids a possible race with a guest OS on another CPU. + */ + smp_rmb(); + if ( (vif->tx_cons == vif->tx_prod) && get_tx_bufs(vif) ) { add_to_net_schedule_list_tail(vif); -- 2.30.2